﻿ var indexPage = {
        bannerListIndex: 1,
        timer: null,
        weekTimer: null,
        bannerPlay: function () {
            var c = this;

            function b(d) {
                $(".adv-nav").find("a.cur").removeClass("cur");
                if (d != "x") {
                    $(".adv-nav").find("a").eq(d).addClass("cur")
                } else {
                    $(this).addClass("cur")
                }
            }
            function a(e, d) {
                $("#adImageList").find("li").hide();
                if (e != "x") {
                    b(c.bannerListIndex);
                    $("#adImageList").find("li").eq(c.bannerListIndex).fadeIn("6000")
                } else {
                    $("#adImageList").find("li").eq(d).fadeIn("6000");
                    c.bannerListIndex = d
                }
                c.bannerListIndex++;
                if (c.bannerListIndex > 1) {
                    c.bannerListIndex = 0
                }
            }
            $(".adv-nav").find("a").mouseover(function () {
                clearInterval(c.timer);
                var d = $(this).attr("set");
                a("x", d);
                b.apply(this, ["x"])
            }).mouseout(function () {
                c.timer = setInterval(a, "6000")
            });
            $("#adImageList").find("li").mouseover(function () {
                clearInterval(c.timer)
            }).mouseout(function () {
                c.timer = setInterval(a, "6000")
            });
            $("#weekHotList li").hover(function () {
                clearInterval(c.weekTimer);
                //$(this).find("a:gt(0)").fadeTo("fast", 0.66)
            }, function () {
                c.weekTimer = setInterval(c.changeWeek, 5000);
                //$(this).find("a:gt(0)").fadeOut("fast")
            });
            this.timer = setInterval(a, "6000");
            this.weekTimer = setInterval(c.changeWeek, 5000)
        },
        changeWeek: function () {
            //$("#weekHotList li").toggle()
        }
 }
 window.onload = indexPage;